<template>
  <div class="dashboard-container">
    <div class="dashboard-text">全省参与率统计</div>
    <div>
      <el-table
        :data="table"
        stripe
        style="width: 100%">
        <el-table-column
          prop="gongsiName"
          label="公司名称">
        </el-table-column>
        <el-table-column
          prop="joinEmp"
          label="参与人数">
        </el-table-column>
        <el-table-column
          prop="totalEmp"
          label="总人数">
        </el-table-column>
        <el-table-column
          prop="joinRate"
          label="参与率">
        </el-table-column>
        <el-table-column
          prop="totalScore"
          label="总得分">
        </el-table-column>
        <el-table-column
          prop="avgScore"
          label="平均分">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { getSummaryData } from '@/api/report'
export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data() {
    return {
      table: []
    }
  },
  mounted() {
    this.getSummary()
  },
  methods: {
    getSummary() {
      getSummaryData().then(res => {
        this.table = res.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
